<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>博客系统登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" media="all" />
<!--[if IE 6]><link type="text/css" rel="stylesheet" href="css/ie6.css" media="all" /><![endif]-->
<script type="text/javascript" src="${pageContext.request.contextPath}/js/mootools.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/site.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">

 function check(show){   

         /*        var url = '${pageContext.request.contextPath}/validateLogin.action';
                var params = $('#userform').serialize();
                  $('#warn').html("<img src='image/ajax/wait.gif'/>"); 

                jQuery.post(url, params, callbackFun); */
              var mName=$('#username').val();
              var mPass=$('#password').val();
              var flag=0;
              if(show=='#warnp'){
                flag=1;
              }
$.ajax({
            
		type:'post',
		url:'${pageContext.request.contextPath}/validateLogin.action',
		//数据格式是json串，商品信息
		/* data:$('#userform').serialize(), */
		dataType:"html",
        data:{username:mName,
              password:mPass,
              flag:flag}, 
		success:function (result) {  
                $(show).html(result);  
            }  
	});
            }

           /*  function callbackFun(data){

                $(show).html(data+111);

            } */
</script>
</head>
<body>
<div id="wrapper">
  <div id="container">
    <div id="scene"> <img src="${pageContext.request.contextPath}/images/scene.jpg" alt="" />
      <h1>博客网站系统</br>
                              欢迎您！${empty sessionScope.username ? "当前尚未登录":sessionScope.username} <br/>
      		<font size="5">${empty sessionScope.idiograph ? "":sessionScope.idiograph}</font>
      </h1>		
      <div id="scale_area">
        <div id="scale_knob">&raquo; Font Size &laquo;</div>
      </div>
      <div id="menu">
        <div class="holder"> <a href="${pageContext.request.contextPath}/showAllArticle.action">博客首页</a> </div>
        <div class="holder"> <a href="${pageContext.request.contextPath}/register.jsp">新博客注册</a> </div>
        <div class="holder"> <a href="${pageContext.request.contextPath}/login.jsp">博客登录</a> </div>
        <div class="holder"> <a href="${pageContext.request.contextPath}/logout1.action">退出</a> </div>
      </div>
    </div>
    <div id="content">
      <div id="col_left">
        <div class="post">
          <div class="meta"></div>
          <div class="comments"><div class="comment"></div>
            <h2>博客登录</h2><font color="red">${requestScope.error }</font>
            <form id="userform" class="h" action="dengLu.action" method="post">
              <div>
                <label>用户名:<font color="red" size=3><span id="warnu" ></span></font></label>
                <input type="text" name="username" id="username" onblur="check('#warnu')"/>
                <input type="hidden" name="url" value="${requestScope.url }"/>
              </div>
              <div>
                <label>密码:<font color="red" size=3><span  id="warnp"></span></font></label>
                <input type="password" name="password" id="password" onblur="check('#warnp')"/>
              </div>
              <div>
                <label></label>
                <div class="clear"> </div>
              </div>
              <div class="button_wrapper">
                <input name="提交" type="submit" class="button" value="登录" />
              </div>
            </form>
          </div>
        </div>
      </div>
      <div id="col_right">
        <div id="search_box">
          <form action="http://www.865171.cn/" method="post">
            <div>
              <input type="text" name="search" />
            </div>
            <div class="button_wrapper">
              <input type="submit" value="Search" class="button" />
            </div>
            <div class="clear"> </div>
          </form>
        </div>
        <div id="sidebar">
          <h2>页面导航</h2>
          <ul>
            <li><a href="${pageContext.request.contextPath}/showAllArticle.action">博客首页</a></li>
            <li><a href="${pageContext.request.contextPath}/register.jsp">新博客注册</a></li>
            <li><a href="${pageContext.request.contextPath}/login.jsp">博客登录</a></li>
          </ul>
        </div>
      </div>
      <div class="clear"> </div>
    </div>
    <div id="footer">
      <div class="clear"> </div>
      <hr />
      <p class="credit">博客网站系统</p>
    </div>
  </div>
</div>
</body>
</html>
